package com.echo.blog.business.blog.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * <p>
 * </p>
 *
 * @author chentl123
 * @since 2019-09-05
 */
@Data
@Document(indexName = "dangdang",type = "blog")
@TableName("echo_business_blog")
public class Blog extends Model<Blog> {

    private static final long serialVersionUID = 1L;

    @Id
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 封面地址
     */
    private String coverUrl;
    /**
     * 标题
     */
    @Field(type = FieldType.text,analyzer = "ik_max_word")
    private String title;
    /**
     * 简介
     */
    @Field(type = FieldType.text,analyzer = "ik_max_word")
    private String intro;
    /**
     * 博客标签
     */
    private Integer blogTag;
    /**
     * 博客列表
     */
    @TableField(exist = false)
    private String blogTagList;
    /**
     * 博客类型
     */
    private Integer blogType;
    /**
     * 博客类型id
     */
    private Integer blogTypeId;
    /**
     * 博客内容
     */
    private String blogContent;
    /**
     * 作者
     */

    private Integer author;
    /**
     * 是否发布 0 否 1 是
     */
    private Integer isPublished;
    /**
     * 创建人
     */
    private Integer createby;
    /**
     * 更新人
     */
    private Integer updateby;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
